﻿<!DOCTYPE html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title></title>
		<script type="text/javascript" src="/node_modules/axios/dist/axios.min.js"></script>
	</head>
	<style type="text/css">
			body{
				font-size:18px;
				color:#fff;
				background:green;
			}
	</style>
	<body>
		I'm login page.
		<br/>
		<button id="btn-login">login</button><br /><br />
		<button id="btn-logout">logout</button><br /><br />
		<button id="btn-logintest">login test</button>
		<script type="text/javascript">
			document.getElementById("btn-login").addEventListener("click", function(){
				doLogin();
			});
			function doLogin(){
				console.log("dologin...");
				axios("/dologin",{method: 'post'}).then(function(res){
					console.log(res.data);
				}).catch(function(res){
					console.log(res);
				});
			}
/*------------*/
			document.getElementById("btn-logout").addEventListener("click", function(){
				logout();
			});
			function logout(){
				console.log("logout...");
				axios("/logout",{method: 'post'}).then(function(res){
					console.log(res.data);
				}).catch(function(res){
					console.log(res);
				});
			}
/*------------*/
			document.getElementById("btn-logintest").addEventListener("click", function(){
				loginTest();
			});
			function loginTest(){
				console.log("loginTest...");
				axios("/logintest",{method: 'post'}).then(function(res){
					console.log(res.data);
				}).catch(function(res){
					console.log(res);
				});
			}

		</script>
	</body>
</html>
